import request from '@/utils/request'

// 查询巡检记录列表
export function listRecord(query) {
  return request({
    url: '/iot/record/list',
    method: 'get',
    params: query
  })
}

//首页统计
export function getCenterTotal(query) {
  return request({
    url: '/bashBoard/getCenterTotal',
    method: 'get',
    params: query
  })
}

//巡检记录首页列表
export function getInspectionRecordListByGroupId(query) {
  return request({
    url: '/bashBoard/getInspectionRecordListByGroupId',
    method: 'get',
    params: query
  })
}
export function alllList(query) {
  return request({
    url: '/iot/record/alllList',
    method: 'get',
    params: query
  })
}

// 查询巡检记录详细
export function getRecord(inspectionRecordId) {
  return request({
    url: '/iot/record/' + inspectionRecordId,
    method: 'get'
  })
}

// 新增巡检记录
export function addRecord(data) {
  return request({
    url: '/iot/record',
    method: 'post',
    data: data
  })
}

// 修改巡检记录
export function updateRecord(data) {
  return request({
    url: '/iot/record',
    method: 'put',
    data: data
  })
}

// 删除巡检记录
export function delRecord(inspectionRecordId) {
  return request({
    url: '/iot/record/' + inspectionRecordId,
    method: 'delete'
  })
}
//巡检日志列表
export function inspectionPlanRecord(query) {
  return request({
    url: '/iot/plan/inspectionPlanRecord',
    method: 'get',
    params: query
  })
}


export function inspectionPlanRecordId(query) {
  return request({
    url: '/iot/plan/inspectionPlanRecord',
    method: 'get',
    params: query
  })
}

export function taskRecordByDay(query) {
  return request({
    url: '/iot/record/taskRecordByDay',
    method: 'get',
    params: query
  })
}

export function trackByUserDay(query) {
  return request({
    url: '/iot/record/trackByUserDay',
    method: 'get',
    params: query
  })
}

export function getScadaInfoId(id) {
  return request({
    url: '/iot/group/getScadaInfo/' + id,
    method: 'get',
  })
}

//单站总流量统计
export function totalFlow(query) {
  return request({
    url: '/iot/flowLog/totalFlow',
    method: 'get',
    params: query
  })
}

//所有站总流量统计
export function sevenTotalFlow(query) {
  return request({
    url: '/iot/flowLog/sevenTotalFlow',
    method: 'get',
    params:query
  })
}

//处理水量
export function handleTotalFlow(query) {
  return request({
    url: '/iot/flowLog/handleTotalFlow',
    method: 'get',
    params:query
  })
}